package com.gismore.demo.dagger;

import lombok.extern.log4j.Log4j2;

import javax.inject.Inject;

@Log4j2
public class Kettle {
	private Heater heater;//电水壶依赖于加热器

	@Inject
	public Kettle(Heater heater) {
		super();
		this.heater = heater;
	}
	public void on(){
		this.heater.on();
	}
	public void off(){
		this.heater.off();
	}
	public void brew(){
		if(heater.isHot()){
			log.info("倒一杯开水");
		}
	}
}
